package com.zw.cc;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.kafka.annotation.KafkaListener;

/**
 * create by zhaowz
 *
 * @date 2017/11/10
 */
@ImportResource(value = "classpath:config/message.xml")
@SpringBootApplication(scanBasePackages = "com.zw.cc")
public class Application {


    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @KafkaListener(topics ="${spring.kafka.template.default-topic}" ,groupId = "policy2")
    public void listen2(ConsumerRecord<?, ?> cr) throws Exception {
        System.out.println("###########{}"+cr.value());
    }


}
